#include "bullet.h"

bullet::bullet()
{
    Bullet.load(":/pic/res/zidan.png");

    bspeed = 2;
    //边框
    b_Rect.setWidth(Bullet.width());
    b_Rect.setHeight(Bullet.height());
    b_Rect.moveTo(b_x , b_y);
}
void bullet::updatePosition()
{
    if(b_free)
    {
        return;
    }
    //子弹位移
    b_y -= bspeed;
    b_Rect.moveTo(b_x , b_y);
    if(b_y <= -b_Rect.height())
    {
        b_free = 1;

    }
}
